package com.googlecode.tabletags.views.jsp.ui;

import org.apache.struts2.views.jsp.ui.AbstractUITag;

import com.googlecode.tabletags.components.AbstractURLComponent;

public abstract class AbstractURLComponentTag extends AbstractUITag {
    // Url attributes
    protected String action;
    protected String method;
    protected String scheme;
    protected String namespace;
    protected String encode;
    protected String url;
    
    /**
     * @see com.opensymphony.webwork.views.jsp.ui.AbstractUITag#populateParams()
     */
    protected void populateParams() {
        super.populateParams();

        AbstractURLComponent urlComp = ((AbstractURLComponent) component);
        urlComp.setAction(action);
        urlComp.setMethod(method);
        urlComp.setNamespace(namespace);
        urlComp.setScheme(scheme);
        urlComp.setUrl(url);
        if(encode != null) {
            urlComp.setEncode(Boolean.valueOf(encode).booleanValue());
        }
    }

    public void setAction(String action) {
        this.action = action;
    }

    public void setEncode(String encode) {
        this.encode = encode;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public void setScheme(String scheme) {
        this.scheme = scheme;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
